<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("emaildb", $con);

$result = mysql_query("SELECT * FROM emaildata2");


?>

<h1> Address Book </h1>
<table border=”1″ cellpadding=”3″ cellspacing =”0″>
<tr>
<th> Date </th>
<th> Subject </th>
<th> From </th>
</tr>
<?php
//loop though all the records
while ($row = mysql_fetch_array($result))
{
echo “<tr>”;
echo “<td>” . $row['Date'] . “</td>”;
echo “<td>” . $row['Subject'] . “</td>”;
echo “<td>” . $row['From'] . “</td>”;
echo “</tr>”;
}
//wipe out result data and close connection
mysql_free_result($result);
mysql_close();
?>
</table>
</body>
</html>


</body>
</html>